<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>科学技术进步奖申报书</title>
@include('common-css')
<style>
.input_box {
    width: 100%;
    height: 40px;
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.input_label {
    width: 120px;
    box-sizing: border-box;
}

.nav_sub_link.doc_download a {
    display: block;
    color: #666;
}
    .task-origin-check-box .ant-checkbox-group-item{
        display: block;
    }
    .complete-tap-pane{
        padding-left: 20px;
    }
</style>
</head>
<body>
<div id="app">

</div>
</body>
</html>

<script id="appTemplate" type="x-template">
<a-locale-provider :locale="antdLocale">
    <div class="container">
        <header class="special">

            <div class="left_info">
                <!-- <img src="/images/icon1.png" alt=""> -->
                <h1>科学技术进步奖申报书</h1>
                <span>申报书所有项都需填写，如无内容填写"无"</span>
            </div>

            <div class="right_user">
                <div class="btn_box">
                    @if ($canEdit)
                        <a-button type="primary" @click="saveInput" :disabled="savingFormData">保存修改</a-button>
                    @endif
                </div>
            </div>

        </header>

        <main>

            <!-- 容器 -->
            <div class="common_container">

                <!-- 侧边栏 -->
                <nav class="common_nav">
                    <div class="nav_content">
                        <div class="nav_link">申报内容</div>
                        <div class="nav_sub_link" v-for="(tab,index) in navBar" :key="index"
                             :class="{'choose':index == currentIndex}" @click="changeBar(index,tab.anchor)">
                            @{{tab.name}}
                        </div>
                        <div class="nav_link">资料下载</div>
                        <div class="nav_sub_link doc_download">
                            <a href="/docs/承诺函-科技进步奖.doc" target="_blank">承诺函模板</a>
                        </div>
                        <div class="nav_sub_link doc_download">
                            <a href="/docs/科技进步奖应用证明模板.docx" target="_blank">应用证明模板</a>
                        </div>
                        <div class="nav_sub_link doc_download">
                            <a href="/docs/科技进步奖完成人合作关系说明模板.docx" target="_blank">完成人合作关系说明模板</a>
                        </div>

                    </div>
                </nav>

                <!-- 内容外部容器区域 -->
                <div class="common_content">

                    <!-- 表单填写内容区域 -->
                    <div class="common_box">

                        <h4 class="common_title" id="one">基本情况</h4>

                        <div class="common_form">

                            <div class="common_form_input_2">
                                <div class="common_form_label">项目名称</div>
                                <div class="common_form_box">
                                    <a-input v-model="formData.basic_situation.project_name" placeholder="项目名称"/>
                                </div>
                            </div>

                            <div class="common_form_input_2">
                                <div class="common_form_label">牵头申报单位</div>
                                <div class="common_form_box">
                                    <a-input v-model="formData.basic_situation.declare_company"
                                             placeholder="牵头申报单位名称"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form">

                            <div class="common_form_input_2">
                                <div class="common_form_label">主要完成人</div>
                                <div class="common_form_box">
                                    <a-input v-model="formData.basic_situation.complete_people" placeholder="多个完成人请用；分隔开"/>
                                </div>
                            </div>

                            <div class="common_form_input_2">
                                <div class="common_form_label">主要完成单位</div>
                                <div class="common_form_box">
                                    <a-input v-model="formData.basic_situation.complete_companies"
                                             placeholder="多个完成单位请用；分隔开"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form">

                            <div class="common_form_input_2">
                                <div class="common_form_label">授权发明专利数量(项)</div>
                                <div class="common_form_box">
                                    <a-input v-model="formData.basic_situation.invention" placeholder="授权发明专利数量"/>
                                </div>
                            </div>
                            <div class="common_form_input_2">
                                <div class="common_form_label">授权的其他知<br/>识产权数量(项)</div>
                                <div class="common_form_box">
                                    <a-input v-model="formData.basic_situation.other_invention" placeholder="授权的其他知识产权数量"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form">
                            <div class="common_form_input_2" style="width: 100%">
                                <div class="common_form_label">所属国家重点<br/>发展领域</div>
                                <div class="common_form_box">
                                    <a-checkbox-group :options="nationalKeyDevelopmentAreas" :value="developDomainSelectedValues" @change="handleDevelopDomainChange" />
{{--                                    <a-checkbox-group :options="nationalKeyDevelopmentAreas" v-model="formData.basic_situation.develop_domain"/>--}}
                                </div>
                            </div>
                        </div>
                        <div class="common_form" style="min-height:160px">
                            <div class="common_form_input_2" style="width: 100%; height:100%">
                                <div class="common_form_label">任务来源</div>
                                <div class="common_form_box task-origin-check-box" style="min-height:160px">
{{--                                    <a-checkbox-group :options="taskOrigins" v-model="formData.basic_situation.task_origin"/>--}}
                                    <a-checkbox-group :options="taskOrigins" :value="taskOriginSelectedValues" @change="handleTaskOriginChange" />
                                </div>
                            </div>
                        </div>


                        <div class="common_form">

                            <div class="common_form_input_2">
                                <div class="common_form_label">项目起止时间</div>
                                <div class="common_form_box">
                                    <a-input v-model="formData.basic_situation.project_dateRange"
                                             placeholder="项目起止时间，如“2017/12 - 2018/12”"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_label">具体计划、基金的名称和编号</div>
                                <div class="common_form_box">
                                    <a-textarea placeholder="具体计划、基金的名称和编号，没有填“无”" class="special_item"
                                                :autosize="{ minRows: 5, maxRows: 5 }"
                                                v-model="formData.basic_situation.plans"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_label">已呈交的科技报告编号</div>
                                <div class="common_form_box">
                                    <a-textarea
                                            placeholder="填写在国家科技计划项目申报中心(http://program.most.gov.cn)呈交的科技报告编号，未呈交填'无'"
                                            class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"
                                            v-model="formData.basic_situation.technical"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_label">科技成果评价机构</div>
                                <div class="common_form_box">
                                    <a-textarea
                                            placeholder="请填写科技成果评价机构"
                                            class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"
                                            v-model="formData.basic_situation.scientific_evaluation_institutions"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_label">科技成果评价水平</div>
                                <div class="common_form_box">
                                    <a-textarea
                                            placeholder="请填写科技成果评价水平'"
                                            class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"
                                            v-model="formData.basic_situation.scientific_evaluation_level"/>
                                </div>
                            </div>

                        </div>

                        <!-- 分割线 -->
                        <div class="hr"></div>
                        <h4 class="common_title" id="two">科技成果简介</h4>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <a-textarea placeholder="应包含项目主要技术内容、授权专利情况、技术经济指标、应用推广及效益情况等" class="special_item"
                                                :autosize="{ minRows: 5, maxRows: 5 }" v-model="formData.scientific"/>
                                </div>
                            </div>

                        </div>

                        <!-- 分割线 -->
                        <div class="hr"></div>
                        <h4 class="common_title" id="three">主要科技创新</h4>
                        <div class="common_desc">(围绕科技创新点的创新性、先进性、创新程度、应用效果和对行业科技进步的作用和示范性，做出客观、真实、准确评价)</div>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <a-textarea placeholder="围绕科技创新点的创新性、先进性、创新程度、应用效果和对行业科技进步的作用和示范性，做出客观、真实、准确评价"
                                                class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"
                                                v-model="formData.innovate"/>
                                </div>
                            </div>

                        </div>

                        <div class="hr"></div>
                        <h4 class="common_title" id="four">客观评价</h4>
                        <div class="common_desc">
                            (围绕科技创新点的创新性、先进性、应用效果和对行业科技进步的作用，做出客观、真实、准确评价。填写的评价意见要有客观依据，主要包括与国内外相关技术的比较，国家相关部门正式作出的技术检测报告、验收意见、鉴定结论及行业机构科技成果评价，国内外重要科技奖励，国内外同行在重要学术刊物、学术专著和重要国际学术会议公开发表的学术性评价意见等，可在附件中提供证明材料。非公开资料（如私人信函等）不能作为评价依据。)
                        </div>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <a-textarea v-model="formData.evaluate"
                                                placeholder="围绕科技创新点的创新性、先进性、应用效果和对行业科技进步的作用，做出客观、真实、准确评价。填写的评价意见要有客观依据，主要包括与国内外相关技术的比较，国家相关部门正式作出的技术检测报告、验收意见、鉴定结论及行业机构科技成果评价，国内外重要科技奖励，国内外同行在重要学术刊物、学术专著和重要国际学术会议公开发表的学术性评价意见等，可在附件中提供证明材料。非公开资料（如私人信函等）不能作为评价依据。"
                                                class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"/>
                                </div>
                            </div>

                        </div>

                        <div class="hr"></div>
                        <h4 class="common_title" id="five">推广应用情况、经济效益和社会效益</h4>
                        <div class="common_desc">(请依据客观数据和情况准确填写，不做评价性描述)</div>
                        <h6 class="common_sub_title">1、推广应用情况</h6>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <a-textarea v-model="formData.generalize.situation"
                                                placeholder="请依据客观数据和情况准确填写，不做评价性描述" class="special_item"
                                                :autosize="{ minRows: 5, maxRows: 5 }"/>
                                </div>
                            </div>

                        </div>
                        <h6 class="common_sub_title">2、近两年经济效益</h6>
                        <div class="common_form_table">
                            <div class="common_form_input_1">
                                <div class="common_form_box">

                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>自然年</th>
                                            <th>完成单位<br/>新增销售额(万元)</th>
                                            <th>完成单位<br/>新增利润(万元)</th>
                                            <th>其他应用单位<br/>新增销售额(万元)</th>
                                            <th>其他应用单位<br/>新增利润(万元)</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.generalize.economic_benefit"
                                            :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td>
                                                <a-input size="small" v-model="record.year" placeholder="格式: 2018"/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.finish_sale" placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.finish_profit" placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.other_sale" placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.other_profit" placeholder=""/>
                                            </td>
                                            <td>
                                                    <span size="mini" type="text" class="common_dele"
                                                          @click="deleteRecord('economic_benefit', record)">删除</span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                    <div class="add_new_tr" v-if="getDataArray('economic_benefit').length < 2"
                                         @click="addRecord('economic_benefit')">
                                        添加 +
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="common_desc" style="margin-top:16px">主要经济效益指标的有关说明</div>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <a-textarea v-model="formData.generalize.description" placeholder="主要经济效益指标的有关说明"
                                                class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"/>
                                </div>
                            </div>

                        </div>
                        <div class="common_desc" style="margin-top:16px">其他经济效益指标的有关说明</div>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <a-textarea v-model="formData.generalize.other_description"
                                                placeholder="其他经济效益指标的有关说明" class="special_item"
                                                :autosize="{ minRows: 5, maxRows: 5 }"/>
                                </div>
                            </div>

                        </div>
                        <h6 class="common_sub_title">3、社会效益</h6>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <a-textarea v-model="formData.generalize.society_benefit" placeholder="社会效益"
                                                class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"/>
                                </div>
                            </div>

                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="six">主要知识产权证明目录</h4>
                        <div class="common_desc">(以下知识产权已征得未列入项目主要完成人的权利人（发明专利指发明人）的同意，不超过10件)</div>
                        <div class="common_form_table">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>知识产权<br/>类别</th>
                                            <th>知识产权<br/>具体名称</th>
                                            <th>国家(地区)</th>
                                            <th>授权号</th>
                                            <th>授权日期</th>
                                            <th>证书编号</th>
                                            <th>权利人</th>
                                            <th>发明人</th>
                                            <th>发明专利<br/>有效状态</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.knowledge_property" :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td>
                                                <a-select style="width: 140px;" size="small" v-model="record.type">
                                                    <a-select-option v-for="ipType in ipTypes" :value="ipType"
                                                                     :key="ipType">@{{ ipType }}
                                                    </a-select-option>
                                                </a-select>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.name" placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.country" placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.authorization_num"
                                                         placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.authorization_date"
                                                         placeholder="格式：2018/12/31"/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.certificate_number"
                                                         placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.obligee" placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.inventor" placeholder=""/>
                                            </td>
                                            <td>
                                                <a-input size="small" v-model="record.status" placeholder=""/>
                                            </td>
                                            <td>
                                                    <span size="mini" type="text" class="common_dele"
                                                          @click="deleteRecord('knowledge_property', record)">删除</span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                    <div class="add_new_tr" v-if="getDataArray('knowledge_property').length < 10" @click="addRecord('knowledge_property')">
                                        + 添加
                                    </div>
                                </div>
                            </div>

                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="seven" style="display: flex;justify-content: flex-start;align-items: center">主要完成人情况表
                            <a-button @click="addCompletePeople" style="margin-left: 20px" size="small">+ 添加人员</a-button>
                        </h4>
                        <div class="complete-tap-pane">
                        <a-tabs
                                hideAdd
                                v-model="completePeopleActiveKey"
                                type="editable-card"
                                @edit="completePeopleEdit"
                        >
                            <a-tab-pane v-for="(peopleInfo, peopleIndex) in formData.finish_people" :tab="peopleInfo.name ? peopleInfo.name : '未命名' " :key="peopleInfo.key">
                                <div style="text-align: right; margin: 8px;">
                                    <a v-if="peopleIndex > 0" style="margin-right: 8px;" href="javascript:;" @click="reorderArrayItem(formData.finish_people, peopleInfo, -1)">向前移动</a>
                                    <a v-if="peopleIndex < formData.finish_people.length - 1" href="javascript:;" @click="reorderArrayItem(formData.finish_people, peopleInfo, 1)">向后移动</a>
                                </div>
                                <div class="common_form">
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">姓&emsp;&emsp;名</div>
                                        <div class="common_form_box">
                                            <a-input style="width:100px" v-model="peopleInfo.name" placeholder="姓名"/>
                                            <a-radio-group v-model="peopleInfo.sex" style="margin-left:20px">
                                                <a-radio value="男">男</a-radio>
                                                <a-radio value="女">女</a-radio>
                                            </a-radio-group>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">排&emsp;&emsp;名</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.rank" placeholder="排名"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">国&emsp;&emsp;籍</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.nationality" placeholder="国籍"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">

                                    <div class="common_form_input_3">
                                        <div class="common_form_label">出生年月</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.birth" placeholder="出生日期"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">出生地址</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.birth_place" placeholder="出生地"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">民&emsp;&emsp;族</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.nation" placeholder="民族，如“汉族”"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">身份证号</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.id_card" placeholder="身份证号"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">归国人员</div>
                                        <div class="common_form_box">
                                            <a-radio-group v-model="peopleInfo.returnee">
                                                <a-radio value="是">是</a-radio>
                                                <a-radio value="否">否</a-radio>
                                            </a-radio-group>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">归国时间</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.return_time" placeholder="归国时间"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">技术职称</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.profession" placeholder="技术职称"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">最高学历</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.education" placeholder="最高学历"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">最高学位</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.degress" placeholder="最高学位"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">毕业学校</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.graduate_school" placeholder="毕业学校"/>
                                        </div>
                                    </div>


                                    <div class="common_form_input_3">
                                        <div class="common_form_label">毕业时间</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.graduate_time" placeholder="毕业时间，如“2014年6月”"/>
                                        </div>
                                    </div>

                                    <div class="common_form_input_3">
                                        <div class="common_form_label">所学专业</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.major" placeholder="所学专业"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">电子邮箱</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.mail" placeholder="电子邮箱"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3">
                                        <div class="common_form_label">办公电话</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.phone" placeholder="办公电话"/>
                                        </div>
                                    </div>

                                    <div class="common_form_input_3">
                                        <div class="common_form_label">移动电话</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.telephone" placeholder="11位常用手机号码"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">
                                    <div class="common_form_input_3_2">
                                        <div class="common_form_label">通讯地址</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.address" placeholder="通讯地址"/>
                                        </div>
                                    </div>

                                    <div class="common_form_input_3_1">
                                        <div class="common_form_label">邮政编码</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.post_code" placeholder="邮政编码，如“200000”"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="common_form">

                                    <div class="common_form_input_3_2">
                                        <div class="common_form_label">工作单位</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.company" placeholder="工作单位"/>
                                        </div>
                                    </div>

                                    <div class="common_form_input_3_1">
                                        <div class="common_form_label">行政职务</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.job" placeholder="行政职务"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">
                                    <div class="common_form_input_3_2">
                                        <div class="common_form_label">二级单位</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.department" placeholder="完成人所在的具体部门，如大学的院系等"/>
                                        </div>
                                    </div>
                                    <div class="common_form_input_3_1">
                                        <div class="common_form_label">党&emsp;&emsp;派</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.groups" placeholder="党派"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form">
                                    <div class="common_form_input_all">
                                        <div class="common_form_label" style="width:220px">参加本项目的起止时间</div>
                                        <div class="common_form_box">
                                            <a-input v-model="peopleInfo.project_range" placeholder="参加项目的起止时间，如“2017/12 - 2018/12”"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="common_form_area">

                                    <div class="common_form_input_1">
                                        <div class="common_form_label">对本项目技术创造性贡献</div>
                                        <div class="common_form_box">
                                            <a-textarea v-model="peopleInfo.contribution" placeholder="不超过300字。应具体写明完成人对本项目做出的实质性贡献并注明对应“主要科技创新”所列第几项科技创新" class="special_item" :autosize="{ minRows: 5, maxRows: 8 }"/>
                                        </div>
                                    </div>

                                </div>

                                <div class="common_form_area">

                                    <div class="common_form_input_1">
                                        <div class="common_form_label">曾获国家（省部及社会力量）科技奖励情况</div>
                                        <div class="common_form_box">
                                            <a-textarea v-model="peopleInfo.award_situation" placeholder="不超过200字。填写完成人曾获科技奖励的获奖年度、奖种、等级、项目名称、排名及证书编号" class="special_item" :autosize="{ minRows: 5, maxRows: 6 }"/>
                                        </div>
                                    </div>

                                </div>
                            </a-tab-pane>
                        </a-tabs>
                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="eight" style="display: flex;justify-content: flex-start;align-items: center">主要完成单位情况
                            <a-button @click="addCompleteCompany" style="margin-left: 20px" size="small">+ 添加单位</a-button>
                        </h4>
                        <div class="complete-tap-pane">
                            <a-tabs
                                    hideAdd
                                    v-model="completeCompanyActiveKey"
                                    type="editable-card"
                                    @edit="completeCompanyEdit"
                            >
                                <a-tab-pane v-for="(companyInfo, companyIndex) in formData.finish_company" :tab="companyInfo.company_name ? companyInfo.company_name : '未命名'" :key="companyInfo.key">
                                    <div style="text-align: right; margin: 8px;">
                                        <a v-if="companyIndex > 0" style="margin-right: 8px;" href="javascript:;" @click="reorderArrayItem(formData.finish_company, companyInfo, -1)">向前移动</a>
                                        <a v-if="companyIndex < formData.finish_company.length - 1" href="javascript:;" @click="reorderArrayItem(formData.finish_company, companyInfo, 1)">向后移动</a>
                                    </div>
                        <div class="common_form">
                            <div class="common_form_input_all">
                                <div class="common_form_label">单位名称</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.company_name" placeholder="单位名称"/>
                                </div>
                            </div>
                        </div>
                        <div class="common_form">
                            <div class="common_form_input_3">
                                <div class="common_form_label">排&emsp;&emsp;名</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.company_rank" placeholder="排名"/>
                                </div>
                            </div>

                            <div class="common_form_input_3">
                                <div class="common_form_label">法&emsp;&emsp;人</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.legal_person" placeholder="法定代表人"/>
                                </div>
                            </div>

                            <div class="common_form_input_3">
                                <div class="common_form_label">所在地址</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.location" placeholder="所在地"/>
                                </div>
                            </div>

                        </div>
                        <div class="common_form">

                            <div class="common_form_input_3">
                                <div class="common_form_label">单位性质</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.company_nature" placeholder="单位性质"/>
                                </div>
                            </div>

                            <div class="common_form_input_3">
                                <div class="common_form_label">传&emsp;&emsp;真</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.company_fax" placeholder="传真"/>
                                </div>
                            </div>


                            <div class="common_form_input_3">
                                <div class="common_form_label">邮政编码</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.post_code" placeholder="邮政编码"/>
                                </div>
                            </div>

                        </div>
                        <div class="common_form">
                            <div class="common_form_input_all">
                                <div class="common_form_label">通讯地址</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.company_address" placeholder="通讯地址"/>
                                </div>
                            </div>
                        </div>
                        <div class="common_form">
                            <div class="common_form_input_3">
                                <div class="common_form_label">联&ensp;系&ensp;人</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.link_man" placeholder="联系人"/>
                                </div>
                            </div>

                            <div class="common_form_input_3">
                                <div class="common_form_label">单位电话</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.company_tel" placeholder="单位电话"/>
                                </div>
                            </div>


                            <div class="common_form_input_3">
                                <div class="common_form_label">移动电话</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.phone" placeholder="移动电话"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form">

                            <div class="common_form_input_all">
                                <div class="common_form_label">电子邮箱</div>
                                <div class="common_form_box">
                                    <a-input v-model="companyInfo.email" placeholder="电子邮箱"/>
                                </div>
                            </div>

                        </div>

                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_label">对本项目科技创新和推广应用情况的贡献</div>
                                <div class="common_form_box">
                                    <a-textarea v-model="companyInfo.contribution" placeholder="对本项目科技创新和推广应用情况的贡献" class="special_item" :autosize="{ minRows: 5, maxRows: 5 }"/>
                                </div>
                            </div>

                        </div>
                                </a-tab-pane>
                            </a-tabs>
                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>


                        <h4 class="common_title" id="nine">附件</h4>
                        <div class="common_desc">文件大小限制：100M。允许上传的文件格式：压缩包(zip/rar)，PDF文档，Office文档(Word/Excel/PPT)，图片(jpg/png)。</div>

                        <table class="form-attachments-table">
                            <tr v-for="(attachmentItem,index) in attachmentItems" :key="index">
                                <td>@{{ index + 1 }}.</td>
                                <td>@{{ attachmentItem.name }}</td>
                                <td class="status">
                                    <span v-if="formData.attachments[attachmentItem.key]">已上传</span>
                                    <span style="color: orange;" v-else>未上传</span>
                                </td>
                                <td class="operations">
                                    <span v-if="formData.attachments[attachmentItem.key]">
                                        <a :href="formData.attachments[attachmentItem.key]" target="_blank">查看</a>
                                    </span>

                                    @if ($canEdit)
                                    <a-upload v-if="attachmentItem.accept_upload_type == 'pdf'" name="file" accept=".pdf" :showUploadList="false"
                                              action="/api/common/upload" :beforeUpload="handleAttachmentBeforeUpload"
                                              :data="{accept_file_type: 'pdf'}"
                                              @change="handleAttachmentUploadChange($event, attachmentItem)">
                                        <a href="javascript:;">@{{ formData.attachments[attachmentItem.key] ? '替换' :
                                            '上传' }}</a>
                                    </a-upload>
                                    <a-upload v-else name="file" accept=".zip,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.jpg,.jpeg,.gif,.png,.tif,.bmp" :showUploadList="false"
                                              action="/api/common/upload" :beforeUpload="handleAttachmentBeforeUpload"
                                              @change="handleAttachmentUploadChange($event, attachmentItem)">
                                        <a href="javascript:;">@{{ formData.attachments[attachmentItem.key] ? '替换' :
                                            '上传' }}</a>
                                    </a-upload>
                                    @endif

                                </td>
                            </tr>
                        </table>

                    </div>

                </div>

            </div>

        </main>
    </div>

</a-locale-provider>
</script>

@include('common-js')

<script>
var applicationId = {{ Request::get('id') }};
var formData = {!! json_encode($formData, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) !!};
console.log(formData)
Vue.prototype.$axios = axios
var app = new Vue({
    el: '#app',
    template: '#appTemplate',
    data: {
        completePeopleActiveKey:'',
        completePeopleNewTabIndex:0,
        completeCompanyActiveKey:'',
        completeCompanyNewTabIndex:0,
        // 进步奖
        formData: {
            type: 'progress', //进步奖
            basic_situation: { //基本情况
                declare_company: '', //申报单位
                project_name: '', //项目名称
                complete_people: '', //主要完成人
                complete_companies: '', //主要完成单位
                develop_domain: [], //国家重点发展领域
                task_origin: [], //任务来
                invention: '', //授权发明专利数量
                other_invention: '', //授权的其他知识产权项
                project_dateRange: '', //项目的起止时间
                plans: '', //具体的计划，基金的编号
                technical: '', //科技报告编号
                scientific_evaluation_institutions: '', // 科技成果评价机构
                scientific_evaluation_level: '', // 科技成果评价水平
            },
            scientific: '', //科技成果简介
            innovate: '', //主要科技创新
            evaluate: '', //客观评价
            generalize: { //推广
                situation: '', //推广应用情况
                economic_benefit: [], //经济效益
                description: '', //经济效益指标说明
                other_description: '', //其他经济效益指标的说明
                society_benefit: '', //社会效益
            },
            knowledge_property: [], //知识产权
            finish_people: [],
            finish_company: [],
            attachments: {
                commitment_letter:null,
                core_ip_certs: null,
                evaluation_certs: null,
                tech_reports: null,
                application_certs: null,
                coauthers: null,
                others: null,
            }
        },
        finish_people_temp:{ //主要完成人情况
            key: '1',
            name: '', //姓名
            sex: '男', //性别 1 男，0 女
            rank: '', //排名
            nationality: '', //国籍
            birth: '', //出生年月
            birth_place: '', //出生地
            nation: '', //民族
            id_card: '', //身份证号
            returnee: '否', //归国人员
            return_time: '', //归国时间
            profession: '', //技术职称
            education: '', //学历
            degress: '', //学位
            graduate_school: '', //毕业学校
            graduate_time: '', //毕业时间
            major: '', //专业
            mail: '', //电子邮箱
            phone: '', //办公电话
            telephone: '', //移动电话
            address: '', //通讯地址
            post_code: '', //邮政编码
            company: '', //工作单位
            job: '', //行政职务
            department: '', //二级单位
            groups: '', //党派
            project_range: '', //项目的起止时间
            contribution: '', //对本项目技术贡献
            award_situation: '', //获奖情况
        },
        finish_company_temp:{
            key: '1',
            company_name: '', //单位名称
            company_rank: '', //单位排名
            legal_person: '', //法人
            location: '', //所在地
            company_nature: '', //单位性质
            company_fax: '', //传真
            post_code: '', //邮政编码
            company_address: '', //通讯地址
            link_man: '', //联系人
            company_tel: '', //单位电话
            phone: '', //移动电话
            email: '', //电子邮箱
            contribution: '', //贡献
        },
        developDomainSelectedValues: [],
        taskOriginSelectedValues: [],
        attachmentItems: [
            {
                name: '承诺函 PDF 扫描件（模板见左侧资料下载）',
                accept_upload_type: 'pdf',
                key: 'commitment_letter',
            },
            {
                name: '核心知识产权证明',
                accept_upload_type: 'all',
                key: 'core_ip_certs'
            },
            {
                name: '评价证明及国家法律法规要求审批的批准文件',
                accept_upload_type: 'all',
                key: 'evaluation_certs'
            },
            {
                name: '科技查新报告',
                key: 'tech_reports'
            },
            {
                name: '应用证明（模板见左侧资料下载）',
                accept_upload_type: 'all',
                key: 'application_certs'
            },
            {
                name: '完成人合作关系说明及情况汇总表（模板见左侧资料下载）',
                accept_upload_type: 'all',
                key: 'coauthers'
            },
            {
                name: '其他证明或补充材料',
                accept_upload_type: 'all',
                key: 'others'
            }
        ],
        industryTypes: [
            'A-农、林、牧、渔业',
            'B-采矿业',
            'C-制造业',
            'D-电力、热力、燃气及水生产和供应业',
            'E-建筑业',
            'F-批发和零售业',
            'G-交通运输、仓储和邮政业',
            'H-住宿和餐饮业',
            'I-信息传输、软件和信息技术服务业',
            'J-金融业',
            'K-房地产业',
            'L-租赁和商务服务业',
            'M-科学研究和技术服务业',
            'N-水利、环境和公共设施管理业',
            'O-居民服务、修理和其他服务业',
            'P-教育',
            'Q-卫生和社会工作',
            'R-文化、体育和娱乐业',
            'S-公共管理、社会保障和社会组织',
            'T-国际组织',
        ],
        nationalKeyDevelopmentAreas: ['节能环保', '新兴信息产业', '生物产业', '高端装备制造业和新材料', '不属于'],
        taskOrigins: [
            'A.国家计划：指正式列入国家计划项目（包括“十二五”、“十三五”相关国家计划体系所支持的项目)',
            'B.部委计划：指国家计划以外，国务院各部委下达的任务',
            'C.省、市、自治区计划：指国家计划以外，由省、市、自治区（或通过有关厅局）下达的任务',
            'D. 企业：指由企业自行出资进行的研究开发项目',
            'E. 国际合作：指由外国单位或个人委托或共同研究、开发的项目',
            'F. 自选：指本基层单位提出或批准的，占用本职工作时间研究开发的项目',
            'G. 其他：指不能归属于上述各类的研究开发项目，如：其他单位委托、非职务项目',
        ],
        subjectTypes: {
            '110': '数学',
            '120': '信息科学与系统科学',
            '130': '力学',
            '140': '物理学',
            '150': '化学',
            '160': '天文学',
            '170': '地球科学',
            '180': '生物学',
            '190': '心理学',
            '210': '农学',
            '220': '林学',
            '230': '畜牧、兽医科学',
            '240': '水产学',
            '310': '基础医学',
            '320': '临床医学',
            '330': '预防医学与公共卫生学',
            '340': '军事医学与特种医学',
            '350': '药学',
            '360': '中医学与中药学',
            '410': '工程与技术科学基础学科',
            '413': '信息与系统科学相关工程与技术',
            '416': '自然科学相关工程与技术',
            '420': '测绘科学技术',
            '430': '材料科学',
            '440': '矿山工程技术',
            '450': '冶金工程技术',
            '460': '机械工程',
            '470': '动力与电气工程',
            '480': '能源科学技术',
            '490': '核科学技术',
            '510': '电子与通信技术',
            '520': '计算机科学技术',
            '530': '化学工程',
            '535': '产品应用相关工程与技术',
            '540': '纺织科学技术',
            '550': '食品科学技术',
            '560': '土木建筑工程',
            '570': '水利工程',
            '580': '交通运输工程',
            '590': '航空、航天科学技术',
            '610': '环境科学技术及资源科学技术',
            '620': '安全科学技术',
            '630': '管理学',
            '710': '马克思主义',
            '720': '哲学',
            '730': '宗教学',
            '740': '语言学',
            '750': '文学',
            '760': '艺术学',
            '770': '历史学',
            '780': '考古学',
            '790': '经济学',
            '810': '政治学',
            '820': '法学',
            '830': '军事学',
            '840': '社会学',
            '850': '民族学与文化学',
            '860': '新闻学与传播学',
            '870': '图书馆、情报与文献学',
            '880': '教育学',
            '890': '体育科学',
            '910': '统计学'
        },
        ipTypes: ['发明专利', '外观', '实用新型', '标准', '软件著作权', '集成电路布图设计', '其它'],
        navBar: [
            {
                name: '基本情况',
                anchor: 'one'
            },
            {
                name: '科技成果简介',
                anchor: 'two'
            },
            {
                name: '主要科技创新',
                anchor: 'three'
            },
            {
                name: '客观评价',
                anchor: 'four'
            },
            {
                name: '推广应用情况',
                anchor: 'five'
            },
            {
                name: '主要知识产权证明目录',
                anchor: 'six'
            },
            {
                name: '主要完成人情况表',
                anchor: 'seven'
            },
            {
                name: '主要完成单位情况',
                anchor: 'eight'
            },
            {
                name: '附件',
                anchor: 'nine'
            }
        ],
        arrayElementDefs: {
            economic_benefit: {
                year: '', //年份
                finish_sale: '', //完成单位新增销售额
                finish_profit: '', //完成单位新增利润
                other_sale: '', //其他单位新增销售额
                other_profit: '' //其他单位新增利润
            },
            knowledge_property: {
                type: '发明专利', //知识产权类别
                name: '', //知识产权具体名称
                country: '', //国家
                authorization_num: '', //授权号
                authorization_date: '', //授权日期
                certificate_number: '', //证书编号
                obligee: '', //权利人
                inventor: '', //发明人
                status: '' //发明专利有效状态
            },
            finish_people: {
                key: '',
                name: '', //姓名
                sex: '男', //性别 1 男，0 女
                rank: '', //排名
                nationality: '', //国籍
                birth: '', //出生年月
                birth_place: '', //出生地
                nation: '', //民族
                id_card: '', //身份证号
                returnee: '否', //归国人员
                return_time: '', //归国时间
                profession: '', //技术职称
                education: '', //学历
                degress: '', //学位
                graduate_school: '', //毕业学校
                graduate_time: '', //毕业时间
                major: '', //专业
                mail: '', //电子邮箱
                phone: '', //办公电话
                telephone: '', //移动电话
                address: '', //通讯地址
                post_code: '', //邮政编码
                company: '', //工作单位
                job: '', //行政职务
                department: '', //二级单位
                groups: '', //党派
                project_range: '', //项目的起止时间
                contribution: '', //对本项目技术贡献
                award_situation: '', //获奖情况
            },
            finish_company: {
                    key: '',
                    company_name: '', //单位名称
                    company_rank: '', //单位排名
                    legal_person: '', //法人
                    location: '', //所在地
                    company_nature: '', //单位性质
                    company_fax: '', //传真
                    post_code: '', //邮政编码
                    company_address: '', //通讯地址
                    link_man: '', //联系人
                    company_tel: '', //单位电话
                    phone: '', //移动电话
                    email: '', //电子邮箱
                    contribution: '', //贡献
                }
        },
        currentIndex: 0,
        applicationId: applicationId,
        savingFormData: false,
        antdLocale: antd.locales.zh_CN
    },
    mounted() {
        copyFieldValueFromObject(this.$data.formData, formData, this.arrayElementDefs)
        if (JSON.stringify(formData) != '{}')
        {
            let developDomain = formData.basic_situation.develop_domain
            if (developDomain) {
                if (Array.isArray(developDomain)) {
                    this.developDomainSelectedValues = developDomain
                } else {
                    this.developDomainSelectedValues = []
                }
            }
            let taskOrigin = formData.basic_situation.task_origin
            if (taskOrigin) {
                if (Array.isArray(taskOrigin)) {
                    this.taskOriginSelectedValues = taskOrigin
                } else {
                    this.taskOriginSelectedValues = []
                }
            }
        }
        console.log('mounted-formData', this.formData)
        if (this.formData.finish_people.length == 0) {
            let completePeopleInfoList = this.formData.finish_people
            let tempPeople = this.finish_people_temp
            completePeopleInfoList.push(tempPeople)
            this.formData.finish_people = completePeopleInfoList
        }
        this.completePeopleActiveKey = this.formData.finish_people[0].key
        if (this.formData.finish_company.length == 0) {
            let completeCompanyList = this.formData.finish_company
            let tempCompany = this.finish_company_temp
            completeCompanyList.push(tempCompany)
            this.formData.finish_company = completeCompanyList
        }
        this.completeCompanyActiveKey = this.formData.finish_company[0].key
    },
    methods: {
        completePeopleEdit (targetKey, action) {
            this[action+'CompletePeople'](targetKey)
        },
        addCompletePeople () {
            let completePeopleInfoList = this.formData.finish_people
            console.log('completePeopleNewTabIndex',this.completePeopleNewTabIndex)
            let timestamp = Date.parse( new Date());
            let activeKey = `${timestamp}-${this.completePeopleNewTabIndex++}`
            let tempPeople = {
                sex: '男',
                returnee: '否',
                key: activeKey
            }
            completePeopleInfoList.push(tempPeople)
            this.formData.finish_people = completePeopleInfoList
            this.completePeopleActiveKey = activeKey
            console.log('finish_people', this.formData.finish_people)
            console.log('completePeopleActiveKey', this.completePeopleActiveKey)
        },
        removeCompletePeople (targetKey) {
            let _this = this
            let peopleListLength = _this.formData.finish_people.length
            console.log(peopleListLength)
            if (peopleListLength < 2) {
                _this.$message.warning('至少保留一个主要完成人',1);
                return false
            }
            _this.$confirm({
                title: '确定删除该完成人吗?',
                content: '',
                onOk() {
                    console.log('delete-index', targetKey)
                    let completePeopleActiveKey = _this.completePeopleActiveKey
                    console.log('completePeopleActiveKey', completePeopleActiveKey)
                    let lastIndex
                    _this.formData.finish_people.forEach((pane, i) => {
                        if (pane.key === targetKey) {
                            lastIndex = i - 1
                        }
                    })
                    console.log('lastIndex', lastIndex)
                    let panes = _this.formData.finish_people.filter(pane => pane.key !== targetKey)
                    if (lastIndex >= 0 && completePeopleActiveKey === targetKey) {
                        completePeopleActiveKey = panes[lastIndex].key
                    } else if (completePeopleActiveKey === targetKey) {
                        completePeopleActiveKey = panes[0].key
                    }
                    _this.formData.finish_people = panes
                    _this.completePeopleActiveKey = completePeopleActiveKey
                },
                onCancel() {
                    return false
                },
            });

        },
        completeCompanyEdit (targetKey, action) {
            this[action+'CompleteCompany'](targetKey)
        },
        addCompleteCompany() {
            let completeCompanyInfoList = this.formData.finish_company
            var timestamp = Date.parse( new Date());
            let activeKey = `${timestamp}-${this.completeCompanyNewTabIndex++}`
            let tempCompany = {
                key:activeKey
            }
            completeCompanyInfoList.push(tempCompany)
            this.formData.finish_company = completeCompanyInfoList
            this.completeCompanyActiveKey = activeKey
        },
        removeCompleteCompany(targetKey) {
            let _this = this
            let companyListLength = this.formData.finish_company.length
            if (companyListLength < 2) {
                this.$message.warning('至少保留一个主要完成单位',1);
                return false
            }
            _this.$confirm({
                title: '确定删除该完成单位吗?',
                content: '',
                onOk() {
                    console.log('delete-index', targetKey)
                    let completeCompanyActiveKey = _this.completeCompanyActiveKey
                    let lastIndex
                    _this.formData.finish_company.forEach((pane, i) => {
                        if (pane.key === targetKey) {
                            lastIndex = i - 1
                        }
                    })
                    console.log('last-index', lastIndex)
                    let panes = _this.formData.finish_company.filter(pane => pane.key !== targetKey)
                    if (lastIndex >= 0 && completeCompanyActiveKey === targetKey) {
                        completeCompanyActiveKey = panes[lastIndex].key
                    }else if (completeCompanyActiveKey === targetKey) {
                        completeCompanyActiveKey = panes[0].key
                    }
                    _this.formData.finish_company = panes
                    _this.completeCompanyActiveKey = completeCompanyActiveKey
                },
                onCancel() {
                    return false
                },
            });
        },
        // 保存修改表单
        saveInput(options) {
            if (typeof options === 'undefined') {
                options = {}
            }
            console.log('data', this.formData)

            // var error = this.validateFormData()
            // if (error) {
            //     antd.message.warn(error, 3)
            //     return
            // }

            this.formData.basic_situation.develop_domain = this.developDomainSelectedValues
            this.formData.basic_situation.task_origin = this.taskOriginSelectedValues
            this.savingFormData = true
            if (!options.silent) {
                antd.message.loading('正在处理，请稍候', 0)
            }
            axios.post('/api/award/save-form-data', {
                id: this.applicationId,
                form_data: this.formData
            }).then(res => {
                if (!options.silent) {
                    antd.message.destroy()
                }
                console.log(res)
                var data = res.data
                if (data.ok) {
                    if (!options.silent) {
                        antd.message.success('申报书修改已保存')
                    }
                } else {
                    antd.message.warn(data.message, 3)
                }
                this.savingFormData = false
            })
        },
        handleTaskOriginChange(checkedValue) {
            if (checkedValue.length > 0 && checkedValue[checkedValue.length - 1] == 'G. 其他：指不能归属于上述各类的研究开发项目，如：其他单位委托、非职务项目'){
                this.taskOriginSelectedValues = ['G. 其他：指不能归属于上述各类的研究开发项目，如：其他单位委托、非职务项目']
            } else if (checkedValue.length) {
                var nonEmptyValues = checkedValue.filter(item => {
                    return item != 'G. 其他：指不能归属于上述各类的研究开发项目，如：其他单位委托、非职务项目'
                })
                if (nonEmptyValues.length) {
                    this.taskOriginSelectedValues = nonEmptyValues
                } else {
                    this.taskOriginSelectedValues = ['G. 其他：指不能归属于上述各类的研究开发项目，如：其他单位委托、非职务项目']
                }
            } else {
                this.taskOriginSelectedValues = ['G. 其他：指不能归属于上述各类的研究开发项目，如：其他单位委托、非职务项目']
            }
        },
        handleDevelopDomainChange(checkedValue) {
            console.log('handleDevelopDomainChange', checkedValue)
            if (checkedValue.length > 0 && checkedValue[checkedValue.length - 1] == '不属于'){
                this.developDomainSelectedValues = ['不属于']
            } else if (checkedValue.length) {
                var nonEmptyValues = checkedValue.filter(item => {
                    return item != '不属于'
                })
                if (nonEmptyValues.length) {
                    this.developDomainSelectedValues = nonEmptyValues
                } else {
                    this.developDomainSelectedValues = ['不属于']
                }
            } else {
                this.developDomainSelectedValues = ['不属于']
            }
        },
        validateFormData() {
            let {basic_situation, scientific, innovate, evaluate, generalize, knowledge_property, finish_people, finish_company, attachments} = this.formData


            if (!basic_situation.declare_company) {
                return "请填写牵头申报单位"
            } else if (!basic_situation.project_name) {
                return "请填写项目名称"
            } else if (!basic_situation.complete_people) {
                return "请填写主要完成人"
            } else if (!basic_situation.complete_companies) {
                return "请填写主要完成单位"
            } else if (!basic_situation.develop_domain) {
                return "请填写国家重点发展领域"
            } else if (!basic_situation.task_origin) {
                return '请填写任务来源'
            } else if (!basic_situation.other_invention) {
                return "请填写授权的其他知识产权"
            } else if (!basic_situation.project_dateRange) {
                return "请填写项目的起止时间"
            } else if (!basic_situation.plans) {
                return "请填写具体的计划"
            } else if (!basic_situation.technical) {
                return '请填写科技报告编号'
            }

            if (!scientific) {
                return "请填写科技成果简介"
            }
            if (!innovate) {
                return "请填写科技创新"
            }
            if (!evaluate) {
                return "请填写科技创新的客观评价"
            }

            if (!generalize.situation) {
                return "请填写推广的应用情况"
            } else if (!generalize.description) {
                return "请填写推广应用的经济效益指标说明"
            } else if (!generalize.other_description) {
                return "请填写推广应用的其他经济效益指标说明"
            } else if (!generalize.society_benefit) {
                return '请填写推广应用的社会效益'
            } else if (generalize.economic_benefit.length == 0) {
                return "请添加推广应用近两年的经济效益"
            }
            if (knowledge_property.length == 0) {
                return "请添加知识产权信息"
            }


            if (!finish_people.name) {
                return "请填写主要完成人员姓名"
            } else if (!finish_people.rank) {
                return "请填写主要完成人员排名"
            } else if (!finish_people.nationality) {
                return "请填写主要完成人员国籍"
            } else if (!finish_people.birth) {
                return "请填写主要完成人员出生日期"
            } else if (!finish_people.birth_place) {
                return "请填写主要完成人员出生地"
            } else if (!finish_people.nation) {
                return "请填写主要完成人员民族"
            } else if (!finish_people.id_card) {
                return "请填写主要完成人员身份证号"
            } else if (!finish_people.returnee) {
                return "请填写主要完成人员归国人员"
            } else if (!finish_people.return_time) {
                return "请填写主要完成人员归国时间"
            } else if (!finish_people.profession) {
                return "请填写主要完成人员技术职称"
            } else if (!finish_people.education) {
                return "请填写主要完成人员最高学历"
            } else if (!finish_people.degress) {
                return "请填写主要完成人员最高学位"
            } else if (!finish_people.graduate_school) {
                return "请填写主要完成人员毕业学校"
            } else if (!finish_people.graduate_time) {
                return "请填写主要完成人员毕业时间"
            } else if (!finish_people.major) {
                return "请填写主要完成人员所学专业"
            } else if (!finish_people.mail) {
                return "请填写主要完成人员电子邮箱"
            } else if (!finish_people.phone) {
                return "请填写主要完成人员办公电话"
            } else if (!finish_people.telephone) {
                return "请填写主要完成人员移动电话"
            } else if (!finish_people.address) {
                return "请填写主要完成人员通讯地址"
            } else if (!finish_people.post_code) {
                return "请填写主要完成人员邮政编码"
            } else if (!finish_people.job) {
                return "请填写主要完成人员行政职务"
            } else if (!finish_people.department) {
                return "请填写主要完成人员二级单位"
            } else if (!finish_people.groups) {
                return "请填写主要完成人员党派"
            } else if (!finish_people.complete_company) {
                return "请填写主要完成人员完成单位"
            } else if (!finish_people.complete_company_address) {
                return "请填写主要完成人员完成单位所在地"
            } else if (!finish_people.complete_company_nature) {
                return "请填写主要完成人员完成单位性质"
            } else if (!finish_people.project_range) {
                return "请填写主要完成人员项目的起止时间"
            } else if (!finish_people.contribution) {
                return "请填写主要完成人员技术贡献"
            } else if (!finish_people.award_situation) {
                return "请填写主要完成人员获奖情况"
            } else if (!finish_people.company) {
                return "请填写主要完成人员工作单位"
            }

            if (!finish_company.company_name) {
                return "请填写主要完成单位单位名称"
            } else if (!finish_company.company_rank) {
                return "请填写主要完成单位单位排名"
            } else if (!finish_company.legal_person) {
                return "请填写主要完成单位法人"
            } else if (!finish_company.location) {
                return "请填写主要完成单位所在地"
            } else if (!finish_company.company_nature) {
                return "请填写单位性质"
            } else if (!finish_company.company_fax) {
                return "请填写主要完成单位传真"
            } else if (!finish_company.post_code) {
                return "请填写主要完成单位邮政编码"
            } else if (!finish_company.company_address) {
                return "请填写主要完成单位通讯地址"
            } else if (!finish_company.link_man) {
                return "请填写主要完成单位联系人"
            } else if (!finish_company.company_tel) {
                return "请填写主要完成单位单位电话"
            } else if (!finish_company.phone) {
                return "请填写主要完成单位移动电话"
            } else if (!finish_company.email) {
                return "请填写主要完成单位电子邮箱"
            } else if (!finish_company.contribution) {
                return "请填写主要完成单位的贡献"
            }

            if (!attachments.core_ip_certs) {
                return "请上传附件中的核心知识产权证明"
            } else if (!attachments.evaluation_certs) {
                return "请上传附件中的评价证明及国家法律法规要求审批的批准文件"
            } else if (!attachments.tech_reports) {
                return "请上传附件中的科技查新报告"
            } else if (!attachments.application_certs) {
                return "请上传附件中的应用证明"
            } else if (!attachments.coauthers) {
                return "请上传附件中的完成人合作关系说明及情况汇总表"
            } else if (!attachments.others) {
                return "请上传附件中的其他证明"
            }

            return false

        },
        handleAttachmentBeforeUpload(file) {
            console.log('handleAttachmentBeforeUpload', file)
            var filename = file.name.toLowerCase()
            var pos = filename.lastIndexOf('.')
            console.log('pos', pos)
            if (pos === -1) {
                antd.message.warn('不允许上传该文件格式')
                return false
            }
            var extension = filename.substring(pos + 1)
            if (['zip', 'rar', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf', 'jpg', 'jpeg', 'gif', 'png', 'tif', 'bmp'].includes(extension)) {
                // antd.message.loading('正在上传，请稍候', 0)
                return true
            } else {
                antd.message.warn('不允许上传该文件格式')
                return false
            }
        },
        handleAttachmentUploadChange(event, attachmentItem) {
            console.log('handleAttachmentUploadChange', event, attachmentItem)
            if (event.file.status == 'done') {
                antd.message.destroy()
                antd.notification.close('uploading')
                if (event.file.response.ok) {
                    antd.message.success(event.file.name + '上传成功')
                    this.formData.attachments[attachmentItem.key] = event.file.response.url
                    this.saveInput({silent: true})
                } else {
                    antd.message.warn(event.file.response.message)
                }
            } else if (event.file.status == 'uploading') {
                antd.notification.open({
                    key: 'uploading',
                    message: '正在上传',
                    description: `进度：${parseInt(event.file.percent)}%`,
                    duration: null,
                })
            } else if (event.file.status == 'error') {
                antd.notification.close('uploading')
                antd.message.error('文件大小超过限制，上传失败')
            }
        },
        addRecord(arrayId) {
            var array = this.getDataArray(arrayId)
            var record = {...this.arrayElementDefs[arrayId]}
            array.push(record)
        },
        deleteRecord(arrayId, record) {
            var array = this.getDataArray(arrayId)
            var pos = array.indexOf(record)
            if (pos > -1) {
                array.splice(pos, 1)
            }
        },
        getDataArray(arrayId) {
            var array
            switch (arrayId) {
                case 'economic_benefit':
                    array = this.formData.generalize.economic_benefit
                    break
                case 'knowledge_property':
                    array = this.formData.knowledge_property
                    break
            }
            return array
        },
        changeBar(index, anchorName) {
            this.currentIndex = index
            document.querySelector(`#${anchorName}`).scrollIntoView()
        },
        reorderArrayItem(array, item, positionChange) {
            var pos = array.indexOf(item)
            if (pos == -1) {
                return
            }
            array.splice(pos, 1)
            array.splice(pos + positionChange, 0, item)
        },
    }
})
</script>